function main(args) {
    var applicationPath = args[0];

    print(__appInfo.AppName, " version ", __appInfo.Version, "\n");
    print(__appInfo.Copyright, "\n\n");
    
    if (args.length != 2) {
        showUsage(applicationPath);
        return;
    }

    if (args[1][0] == "-") {
        switch (args[1]) {
            case "-l":
                showLicense();
                break;
            case "-?":
            case "-h":
            default:
                showUsage(applicationPath);
        }
        return;
    }

    return runTests( args[1] );
}

function runTests(testFixtureFile) {
    include(testFixtureFile);
    return TestRunner.run();
}

function showUsage(applicationPath) {
    print("Usage: ", applicationPath, " [testFixture.js | options]\n");
    print("Options: -? | -h  Show usage\n");
    print("         -l       Display license\n");
}

function showLicense() {
    print("------------------------------- jssUnit License -------------------------------\n");
    print(loadString("JSSUNIT_LICENSE"), "\n");
    print("---------------------------------- v8 License ----------------------------------\n");
    print(loadString("V8_LICENSE"), "\n");
}